<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>意见管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/opinion/list">意见列表</a></li>
		<shiro:hasPermission name="sys:opinion:save"><li><a href="${ctx}/sys/opinion/openSave">意见添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="opinion" action="${ctx}/sys/opinion/" method="post">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>标题</th>
				<th>意见内容</th>
				<th>反馈内容</th>
				<th>创建者</th>
				<th>创建时间</th>
				<th>状态 </th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:choose>
			<c:when test="${not empty page.list}">
				<c:forEach items="${page.list}" var="opinion">
					<tr>
						<td><a href="${ctx}/sys/opinion/openUpdate?id=${opinion.id}">
							${opinion.names}
							</a>
						</td>
						<td>
							${opinion.describes}
						</td>
						<td>
							${opinion.feedback}
						</td>
						<td>
							${opinion.createByName}
						</td>
						<td>
							<fmt:formatDate value="${opinion.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
						</td>
						<td>
							<c:if test="${opinion.state == 0}"><span style="color:red">未处理</span></c:if>
							<c:if test="${opinion.state == 1}"><span style="color:blue;">已处理</span></c:if>
						</td>
						<td>
							<shiro:hasPermission name="sys:opinion:update">
							<c:if test="${opinion.state == 0}">
								<a title="回馈信息" href="${ctx}/sys/opinion/openUpdate?id=${opinion.id}" class="btn-link"><i class="icon-pencil"></i></a>&nbsp;</a>
							</c:if>
							</shiro:hasPermission>
						</td>
					</tr>
				</c:forEach>
			</c:when>
			<c:otherwise>
				<tr>
					<td colspan="8" style="text-align: center;font-size:17px; font-family:SimHei">未查询到数据...</td>
				</tr>
			</c:otherwise>
			</c:choose>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>